<template>
	<div class="mainCont">
		<div class="leftCont">
			<ul class="snav">

				<li v-if="$permissions.indexOf(216) != -1">
					<router-link to="/unit" v-if="$route.name=='unit'" @click.native="flushCom"
						:class="$route.name=='unit'?'active':''">巡检单元</router-link>
					<router-link to="/unit" v-else :class="$route.name=='unit'?'active':''">巡检单元</router-link>
				</li>
				<li v-if="$permissions.indexOf(222) != -1">
					<router-link to="/assetInspection" v-if="$route.name=='assetInspection'" @click.native="flushCom"
						:class="$route.name=='assetInspection'?'active':''">巡检资产</router-link>
					<router-link to="/assetInspection" v-else :class="$route.name=='assetInspection'?'active':''">巡检资产</router-link>
				</li>
				<li v-if="$permissions.indexOf(222) != -1">
					<router-link to="/plan" v-if="$route.name=='plan'" @click.native="flushCom"
						:class="$route.name=='plan'?'active':''">巡检计划</router-link>
					<router-link to="/plan" v-else :class="$route.name=='plan'?'active':''">巡检计划</router-link>
				</li>
				<li v-if="$permissions.indexOf(222) != -1">
					<router-link to="/quest" v-if="$route.name=='quest'" @click.native="flushCom"
						:class="$route.name=='quest'?'active':''">巡检任务</router-link>
					<router-link to="/quest" v-else :class="$route.name=='quest'?'active':''">巡检任务</router-link>
				</li>
				<li v-if="$permissions.indexOf(228) != -1">
					<router-link to="/record" v-if="$route.name=='record'" @click.native="flushCom"
						:class="$route.name=='record'?'active':''">巡检记录</router-link>
					<router-link to="/record" v-else :class="$route.name=='record'?'active':''">巡检记录</router-link>
				</li>

				<li v-if="$permissions.indexOf(236) != -1 || $permissions.indexOf(240) != -1">
					<a href="#" @click="down5=!down5">巡检统计 <span class="iconfont icon-up"
							:style="down5?'transform: rotateZ(180deg);':'transform: rotateZ(0deg);'"></span></a>
					<div class="down" v-if="down5">
						<router-link to="/inspect_day" v-if="$route.name=='inspect_day' && $permissions.indexOf(236) != -1"
							@click.native="flushCom" :class="$route.name=='inspect_day'?'active':''">按天统计
						</router-link>
						<router-link to="/inspect_day" v-if="$permissions.indexOf(236) != -1 && $route.name !='inspect_day' "
							:class="$route.name=='inspect_day'?'active':''">按天统计
						</router-link>

						<router-link to="/inspect_peo" v-if="$route.name=='inspect_peo' && $permissions.indexOf(240) != -1"
							@click.native="flushCom" :class="$route.name=='inspect_peo'?'active':''">按工程师统计
						</router-link>
						<router-link to="/inspect_peo"
							v-if="$permissions.indexOf(240) != -1 && $route.name !='inspect_peo' "
							:class="$route.name=='inspect_peo'?'active':''">按工程师统计
						</router-link>
					</div>
				</li>
				
				<li v-if="$permissions.indexOf(250) != -1 || $permissions.indexOf(258) != -1">
					<a href="#" @click="down4=!down4">巡检设置 <span class="iconfont icon-up"
							:style="down4?'transform: rotateZ(180deg);':'transform: rotateZ(0deg);'"></span></a>
					<div class="down" v-if="down4">
						<router-link to="/period" v-if="$route.name=='period' && $permissions.indexOf(250) != -1"
							@click.native="flushCom" :class="$route.name=='period'?'active':''">巡检周期
						</router-link>
						<router-link to="/period" v-if="$permissions.indexOf(250) != -1 && $route.name !='period' "
							:class="$route.name=='period'?'active':''">巡检周期
						</router-link>
				
						<router-link to="/inspect_type" v-if="$route.name=='inspect_type' && $permissions.indexOf(258) != -1"
							@click.native="flushCom" :class="$route.name=='inspect_type'?'active':''">巡检类型
						</router-link>
						<router-link to="/inspect_type"
							v-if="$permissions.indexOf(258) != -1 && $route.name !='inspect_type' "
							:class="$route.name=='inspect_type'?'active':''">巡检类型
						</router-link>
					</div>
				</li>
				
			</ul>

		</div>

		<div class="rightCont">
			<router-view>
			</router-view>
		</div>

	</div>
</template>
<script type="text/babel">
	import Vue from 'vue'
	export default {
		name: "",
		data() {
			return {
				down5:true,
				down4:true,
				permissions:[]
			};
		},
		created() {},
		mounted() {
			var that = this
			// console.log(that.$permissions)
			// console.log('巡检')
			// console.log(that.$permissions)
			// if(!this.$route.params.title){
				
			// var url = ''
			
			// var t = setTimeout(function(){
				that.permissions = that.$permissions
			// 	console.log(that.permissions.indexOf(216))
			// 	if(that.permissions.indexOf(216) != -1){
			// 		console.log('------------unit----------------------------------')
			// 		that.$router.push('/unit');
			// 	}else if(that.permissions.indexOf(222) != -1){
			// 		that.$router.push('/assetInspection');
			// 	}else if(that.permissions.indexOf(228) != -1){
			// 		that.$router.push('/record');
			// 	}else if(that.permissions.indexOf(236) != -1){
			// 		that.$router.push('/inspect_day');
			// 	}else if(that.permissions.indexOf(240) != -1){
			// 		that.$router.push('/inspect_peo');
			// 	}else if(that.permissions.indexOf(250) != -1){
			// 		that.$router.push('/period');
			// 	}else if(that.permissions.indexOf(258) != -1){
			// 		that.$router.push('/inspect_type');
			// 	}
			// 	clearTimeout(t)
			// },200)
			// }else{
			// 	that.permissions = that.$permissions
			// }
			
		},
	
		methods: {
			flushCom:function(){
				return
		　　},
			
		},

		computed: {
			
		},
	};
</script>
<style lang='less' scoped>
	/deep/sup {
		top: 0;
		margin-bottom: 3px;
	}

	/deep/.el-badge__content {
		height: auto;
	}

	li {
		background: #fff;
		position: relative;
		z-index: 2;

	}

	.rightCont {
		position: relative;
	}

	.icon-up {
		transition: all .3s;
	}

	.down {
		transition: all .3s;
	}
</style>
